Introspection: modules associated constants#5150
Conversation
|
How can i add labels? (to skip the changelog check) |
|
Thank you! For the labels, I think you need some rights on this repo to do that. On the MR itself:
|
|
Actually I think we probably do want changelog entries for these additions now, as the original version of this introspection shipped in 0.25. It would be good to document improvements to it as future releases come. |
Currently, constants defined outside a module and then re-exported are not supported. If we eventually decide to go with the What do you think? |
Indeed. However, I would feel better to have an as open to evolution introspection data format as possible: the pyo3-introspection crate will be a dependency of eg. Maturin so we having forward and backward compatibility as much as possible would be amazing. I believe we can always add I am also a bit scared about What about having a dumb but easy behavior like: const PI: f64 = std::f64::consts::PI;emits: PI: typing.Final = ...and in a follow up MR: PI: typing.Final[float] = ...and const PI: f64 = 3.14;emit: PI: typing.Final = 3.14What do you think? In this case, having a |
I think it's a bit odd to implement it this way without the
You're right!
On second thought, I agree with you. |
Tpt
left a comment
There was a problem hiding this comment.
Thank you!
I think it's a bit odd to implement it this way without the pyconst macro, I'm open to implement the macro in this PR if you think that's the right approach.
I tend to think it's out of scope of this PR. But I would love to see it in a follow-up if PyO3 maintainers agree.
This MR looks good to me, but I do not have merge right on PyO3.
* Adds introspection for modules associated constants * Add support for `Final` constants. * Document changes * Review fixes * Fix typo
* Adds introspection for modules associated constants * Add support for `Final` constants. * Document changes * Review fixes * Fix typo
No description provided.